//切换中英文
let item = localStorage.getItem("count");
console.log("count="+item);
if (item != null) {
    if (parseInt(item) > 5) {
        console.log("计数器到达10可以清空了");
        localStorage.clear();
    }
}

//跳转到登录页
function jumpLoginPage() {
    $("#jump").attr("href",JUMP_LOGIN);
}
//跳转到登录页
function returnLoginPage() {
    window.location.href=BASE_URL+JUMP_LOGIN;
}



//切换中英文 checkbox状状态观察 true为选择状态 false未选择  ajax请求
function checkbox() {
    //计数器
    let item1 = localStorage.getItem("count");
    if (item1 != null) {
        let number = parseInt(item1);
        number++;
        localStorage.setItem("count",""+number);
        console.log("number="+number);
    }else {
        localStorage.setItem("count","0");
    }

    if (parseInt(localStorage.getItem("count"))%2 === 0) {
        //偶数为英文
        window.location.href=BASE_URL+JUMP_LOGIN+"?language=en_US";
        console.log("中文");
        return;
    }
    console.log("英文");
    window.location.href=BASE_URL+JUMP_LOGIN+"?language=zh_CN";
}

//登录
function login(username,password) {
    $("#loginForm").attr("action",BASE_URL+LOGIN_URL).submit();
}

